package com.sell.sell.util;

import com.sell.sell.enums.ResultEnum;
import com.sell.sell.vo.ResultVO;

/**
 * 描述:
 * ${DESCRIPTION}
 *
 * @author hzp
 * @create 2018-09-29 17:51
 */
public class ResultVOUtil {

    public static ResultVO success(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(ResultEnum.SUCCESS.getCode());
        resultVO.setMsg(ResultEnum.SUCCESS.getMsg());
        return resultVO;
    }

    public static ResultVO success() {
        return success(null);
    }

    public static ResultVO error(String msg,Integer code) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
